<?php
header("Content-type: text/html; charset=utf-8");
if($_POST){
	if($_POST['name'] ==''){
		$_POST['name'] == '游客';
	}elseif ($_POST['content'] =='') {
		$error = "请不要提交空信息，灌水是不对的！！";
 		include './tpl/error.html';
	}
	$db = include './db.php';
	$hidden = $_POST['hidden'];
	unset($db[$hidden]);		
	unset($_POST['hidden']);	
	$db[$hidden] = $_POST;
	$newDb = var_export($db,TRUE);
	$newDb = "<?php return $newDb ?>";
	file_put_contents('./db.php', $newDb); 
	$message = "修改成功";
	include './tpl/success.html';	
}else {
	$error = "修改失败";
 	include './tpl/error.html';
}
	




?>